import http from '../util/http.js';

export default {
    login:(obj)=>{
        const captcahkey=sessionStorage.getItem("captchaKey");
        obj.captchakey=captcahkey;
        return http({
            method:'post',
            params:obj,
            url:'api/user/login',
            // Cookie:{name:'123'}
        })
    },


    getCaptcha:()=>{
        return http({
            method:'get',
            url:'api/captcha/base'
        })
    },

    getChartsA:()=>{
        return http({
            method:"get",
            url:"api/charts/chartsA"
        });
    },
    getChartsB:()=>{
        return http({
            method:"get",
            url:"api/charts/chartsB"
        });
    },
    getChartsC:()=>{
        return http({
            method:"get",
            url:"api/charts/chartsC"
        });
    },
    getChartsD:()=>{
        return http({
            method:"get",
            url:"api/charts/chartsD"
        });
    },
    getChartsE:()=>{
        return http({
            method:"get",
            url:"api/charts/chartsE"
        });
    },
//用户信息增删改查
    getUserList:()=>{
        return http({
            method:"get",
            url:"api/user/list"

        });
    },
    getUserPage:(page)=>{
        return http({
            method:'get',
            url:'api/user/page',
            params:page
        });
    },
    deleteUser:(userId)=>{
        return http({
            method:'delete',
            url:'api/user/'+userId
        });
    },
    addUser:(obj)=>{
        return http({
            method:'post',
            url:'api/user',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },
    editUser:(obj)=>{
        return http({
            method:'put',
            url:'api/user',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },

//电影信息增删改查
    getMovieList:()=>{
        return http({
            method:"get",
            url:"api/movie/list"

        });
    },
    getMoviePage:(page)=>{
        return http({
            method:'get',
            url:'api/movie/page',
            params:page
        });
    },
    deleteMovie:(movieId)=>{
        return http({
            method:'delete',
            url:'api/movie/'+movieId
        });
    },
    addMovie:(obj)=>{
        return http({
            method:'post',
            url:'api/movie',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },
    editMovie:(obj)=>{
        return http({
            method:'put',
            url:'api/movie',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },

//电影类别增删改查

    getMovieCategoryList:()=>{
        return http({
            method:"get",
            url:"api/movieCategory/list"
        });
    },
    getMovieCategoryPage:(page)=>{
        return http({
            method:'get',
            url:'api/movieCategory/page',
            params:page
        });
    },
    deleteMovieCategory:(movieCategoryId)=>{
        return http({
            method:'delete',
            url:'api/movieCategory/'+movieCategoryId
        });
    },
    addMovieCategory:(obj)=>{
        return http({
            method:'post',
            url:'api/movieCategory',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },
    editMovieCategory:(obj)=>{
        return http({
            method:'put',
            url:'api/movieCategory',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },


//订单信息增删改查
    getBillList:()=>{
        return http({
            method:"get",
            url:"api/bill/list"

        });
    },
    getBillPage:(page)=>{
        return http({
            method:'get',
            url:'api/bill/page',
            params:page
        });
    },
    deleteBill:(billId)=>{
        return http({
            method:'delete',
            url:'api/bill/'+billId
        });
    },
    addBill:(obj)=>{
        return http({
            method:'post',
            url:'api/bill',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },
    editBill:(obj)=>{
        return http({
            method:'put',
            url:'api/bill',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },


//影厅信息增删改查
    getHallList:()=>{
        return http({
            method:"get",
            url:"api/hall/list"

        });
    },
    getHallPage:(page)=>{
        return http({
            method:'get',
            url:'api/hall/page',
            params:page
        });
    },
    deleteHall:(hallId)=>{
        return http({
            method:'delete',
            url:'api/hall/'+hallId
        });
    },
    addHall:(obj)=>{
        return http({
            method:'post',
            url:'api/hall',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },
    editHall:(obj)=>{
        return http({
            method:'put',
            url:'api/hall',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },


//场次信息增删改查
    getSessionList:()=>{
        return http({
            method:"get",
            url:"api/session/list"
        });
    },
    getSessionPage:(page)=>{
        return http({
            method:'get',
            url:'api/session/page',
            params:page
        });
    },
    deleteSession:(sessionId)=>{
        return http({
            method:'delete',
            url:'api/session/'+sessionId
        });
    },
    addSession:(obj)=>{
        return http({
            method:'post',
            url:'api/session',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },
    editSession:(obj)=>{
        return http({
            method:'put',
            url:'api/session',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },

    //角色
    getRoleList:()=>{
        return http({
            method:"get",
            url:"api/role/list"
        });
    },
    getRolePage:(page)=>{
        return http({
            method:'get',
            url:'api/role/page',
            params:page
        });
    },
    deleteRole:(roleId)=>{
        return http({
            method:'delete',
            url:'api/role/'+roleId
        });
    },
    addRole:(obj)=>{
        return http({
            method:'post',
            url:'api/role',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },
    editRole:(obj)=>{
        return http({
            method:'put',
            url:'api/role',
            data: obj,   //提交json数据要有header
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        })
    },
    

}